package reflect;
@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 22;
    public Person(){}

    public Person(String name,int age){
        this.name = name;
        this.age = age;

    }
    @AutoRun
    public  void sayHello(){
        System.out.println(name+"大家好！");
    }
    public void sayHi(){
        System.out.println(name+":Hi!!");
    }
    public  void say(String info ){
        System.out.println(name+":说"+info);
    }
    public void say(String info,int sum){
        for (int i= 0;i<sum;i++){
            System.out.println(name+"说:"+info);
        }
    }
    @AutoRun
    public void playGame(){
        System.out.println(name+"玩游戏");
    }

    public void watchTV(){
        System.out.println(name+"正在看电视");
    }

    private void  dosome(){
        System.out.println("这是Person类的私有方法");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
